package Windows;


import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Label;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JTextArea;

//import com.sun.codemodel.internal.JLabel;

public class ChatWindow extends JFrame{
	
	private Label label;
	private JPanel p1,p2,p3,p4;
	private JTextArea textArea,textArea1;
	public static void main(String[] args) {
		ChatWindow test3=new ChatWindow();
	}
	public ChatWindow(){
		setTitle("聊天窗口");
		setSize(900,500);
		setResizable(false);//窗口大小不能改变
		setLocationRelativeTo(null);
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		
		getContentPane().setLayout(new BorderLayout());
		getContentPane().setBackground(Color.blue);
		

		p1=new JPanel();
		p1.setBackground(Color.pink);
		label=new Label("和...聊天中");
		label.setSize(30, 30);
		p1.add(label);
		add(p1,"North");
		
		p2=new JPanel();
		//p2.setBackground(Color.blue);
		textArea=new JTextArea(" ",15,70);
		textArea.setLineWrap(true);//自动换行
		p2.add(textArea);
		add(p2,"Center");
		p3=new JPanel();
		textArea1=new JTextArea(" ",10,60);
		p3.add(textArea1);
		//p3.setBackground(Color.green);
		add(p3,"South");
		JButton button;
		button=new JButton("发送");
		button.setActionCommand("aa");
		p4=new JPanel();
		add(p4,"East");
		p3.add(button);
		setVisible(true);
	}
	public Label getLabel() {
		return label;
	}
	public void setLabel(Label label) {
		this.label = label;
	}
	public JTextArea getTextArea() {
		return textArea;
	}
	public void setTextArea(JTextArea textArea) {
		this.textArea = textArea;
	}
	public JTextArea getTextArea1() {
		return textArea1;
	}
	public void setTextArea1(JTextArea textArea1) {
		this.textArea1 = textArea1;
	}
	
}

